import itertools
import pandas as pd

# 定义20种标准氨基酸
AMINO_ACIDS = ['A', 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I', 'L', 'K', 'M', 'F', 'P', 'S', 'T', 'W', 'Y', 'V']

# 生成所有可能的三个氨基酸组合
all_combinations = list(itertools.product(AMINO_ACIDS, repeat=3))

# 将组合转换为序列
sequences = [''.join(combo) for combo in all_combinations]

# 创建DataFrame
df = pd.DataFrame({
    'Peptide_Sequence': sequences,
    'Status': [0] * len(sequences),
    'DPP4_Digested': [0] * len(sequences),
    'No_DPP4': [0] * len(sequences),
    'First3AA': sequences  # First3AA与Peptide_Sequence相同
})

# 保存为CSV文件
output_file = 'all_tripeptides.csv'
df.to_csv(output_file, index=False)
print(f'已生成{len(sequences)}个三肽组合，保存到{output_file}')